package com.global.vo;

import com.global.model.SystemType;

/**
 * Web页面中组件参数  VO
 * @author zly601436
 *
 */
public class WebObject {

	String name;
	String decription;
	
	SystemType systemType;
	
	public WebObject() {
		
	}
	public WebObject(SystemType systemType) {
		this.systemType = systemType;
		if(this.systemType!=null){
			this.name = this.systemType.getName();
			this.decription = this.systemType.getDescription();			
		}
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public String getDecription() {
		return decription;
	}
	public void setDecription(String decription) {
		this.decription = decription;
	}

	public SystemType getSystemType() {
		return systemType;
	}
	public void setSystemType(SystemType systemType) {
		this.systemType = systemType;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result
				+ ((systemType == null) ? 0 : systemType.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj){
			return true;
		}
		if (obj == null){
			return false;
		}
		if (getClass() != obj.getClass()){
			return false;
		}
		
		WebObject other = (WebObject) obj;
		if (systemType == null) {
			if (other.systemType != null){
				return false;
			}
		} else if (!systemType.equals(other.systemType)){
			return false;
		}
		if (name == null) {
			if (other.name != null){
				return false;
			}
		} else if (!name.equals(other.name)){
			return false;
		}

		return true;
	}
	@Override
	public String toString() {
		return "DataType [name=" + name + ", decription=" + decription + "]";
	}
	
	
}
